#ifndef MYMUSIC_WLQUEUE_H
#define MYMUSIC_WLQUEUE_H
#include<queue>
#include <pthread.h>

#include "../config/AndroidLog.h"
#include "WlPlaystatus.h"


extern "C"
{
#include "../thirdpart/libavcodec/avcodec.h"
};


class WlQueue {

public:
    std::queue<AVPacket *> queuePacket;
    pthread_mutex_t mutexPacket;
    /**条件对象*/
    pthread_cond_t condPacket;
    WlPlaystatus *playstatus = NULL;

public:
    WlQueue(WlPlaystatus *playstatus);
    ~WlQueue();

    int putAvpacket(AVPacket *packet);
    int getAvpacket(AVPacket *packet);
    int getQueueSize();
    void clearAvpacket();
    /**唤醒第一个调用 pthread_cond_wait ()而进入睡眠的线程*/
    void noticeQueue();
};


#endif //MYMUSIC_WLQUEUE_H
